import request from '@/utils/request'

/**
 * 计划招聘记录列表
 */
export function hrmRecruitRecordQueryListAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/queryRecruitPlanRecordPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 计划招聘记录详情
 */
export function hrmRecruitRecordQueryByIdAPI(recordId) {
  return request({
    url: 'hrmRecruitPlanRecord/queryById/' + recordId,
    method: 'post',
  })
}

/**
 * 上报招聘计划记录
 * @param {*} id
 */
export function hrmRecruitRecordReportAPI() {
  return request({
    url: `hrmRecruitPlan/syncPlanRecord`,
    method: 'post'
  })
}

/**
 * 计划招聘记录新增
 */
export function hrmRecruitRecordAddAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/addRecruitPlanRecord',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 计划招聘记录修改
 */
export function hrmRecruitRecordSetAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/setRecruitPlanRecord',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 计划招聘记录删除
 */
export function hrmRecruitRecordDeleteAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/batchDeleteRecruitPlanRecord',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 计划招聘记录导出
 */
export function hrmRecruitRecordExportAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/exportRecruitPlanRecord',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 获取导入模板
 * @param {*} data
 */
export function recordImportTemplateAPI() {
  return request({
    url: 'hrmRecruitPlanRecord/downloadExcel',
    method: 'post',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 导入
 * @param {*} data
 */
export function recordExcelImportAPI(data) {
  return request({
    url: 'hrmRecruitPlanRecord/excelImport',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

